home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_10_03
/
1003075a
< prev
next >
Wrap
Text File
|
1992-01-11
|
457b
|
34 lines
Listing 8
//
// rational.cpp
//
#include "mylib.h"
#include "rational.h"
rational rational::operator-()
{
rational result(*this);
result.num = -result.num;
return result;
}
rational rational::operator++(int)
{
rational result(*this);
*this += 1;
return result;
}
rational rational::operator--(int)
{
rational result(*this);
*this -= 1;
return result;
}
// ... the rest of rational.cpp as in Listing 2